#ifndef PREPROCESSOR_H
#define PREPROCESSOR_H
#include <opencv2\opencv.hpp>
#include <opencv2\core\core.hpp>
#include <opencv2\imgproc\imgproc.hpp>
#include <opencv2\highgui\highgui.hpp>
#include <opencv2\calib3d\calib3d.hpp>
#include <QObject>
#include <QImage>
#include <Qdebug>
#include <deque>
#include "tools.hpp"
using namespace std;
//using namespace cv;
class Preprocessor : public QObject
{
	Q_OBJECT
private:
	bool discriminator(unsigned char * data, bool(*func)(unsigned char * data));
	bool flag = true;
	bool require_flag = false;
	int send_flag;
	queue<unsigned char*> *rgb_raw_data;
	queue<unsigned char*> *spe_raw_data;
	queue<FrameData> *frame_data_0;
	queue<FrameData> *frame_data_1;
	float *rgb_map;
	float *spe_map_1;
	float *spe_map_2;
	int offset_value = 0;

	FILE *BAIS_DATA;
	float * bais;
	unsigned char noise;

public:
	explicit Preprocessor(QObject *parent = 0);
	bool continue_signal = true;
	RawInfo rawinfo;
signals:
	void Done();

public slots:
	void receive(queue<unsigned char*> *_rgb_raw_data, queue<unsigned char*> *_spe_raw_data, queue<FrameData> * _frame_data_0, queue<FrameData> * _frame_data_1, float *_rgb_map, float *_spe_map_1, float *_spe_map_2);
	void setOffset(int value);
	void preprocess();
};

#endif
